package com.qs.eggs.view.ordermanager.fragment;

import android.view.View;

import com.google.gson.reflect.TypeToken;
import com.qs.eggs.view.ordermanager.adapter.OrderManagerAdapter;
import com.qs.eggs.api.HttpApi;
import com.qs.eggs.bean.OrderBean;
import com.qs.eggs.refresh.adapter.BaseRecyclerAdapter;
import com.qs.eggs.refresh.fragments.BaseRecyclerViewFragment;

import java.lang.reflect.Type;
import java.util.ArrayList;

public class WaitEvaluationFragment extends BaseRecyclerViewFragment<OrderBean> {

    @Override
    protected BaseRecyclerAdapter<OrderBean> getRecyclerAdapter() {
        return new OrderManagerAdapter(getActivity(), BaseRecyclerAdapter.ONLY_FOOTER);
    }

    @Override
    protected void initWidget(View root) {
        super.initWidget(root);

    }

    @Override
    public void initData() {
        super.initData();

      //  mAdapter.setSystemTime(AppConfig.getAppConfig(getActivity()).get("system_time"));
    }

    @Override
    public void onItemClick(int position, long itemId) {
        super.onItemClick(position, itemId);
        OrderBean sub = mAdapter.getItem(position);

        if (sub == null)
            return;
      //  LikeDetailActivity.show(mContext, sub.getId());
    }

    @Override
    protected void requestData() {
        super.requestData();
//        HashMap<String,String> map=new HashMap<>();
//        map.put("uid", AccountHelper.getUserId()+"");
        HttpApi.getOrders("3",mHandler);

    }

    @Override
    protected Type getType() {
        return new TypeToken<ArrayList<OrderBean>>() {
        }.getType();
    }
}